package com.xxx.video.mine.activitys;

import android.os.Bundle;
import android.widget.CompoundButton;

import androidx.appcompat.widget.SwitchCompat;

import com.xxx.video.R;
import com.xxx.video.commen.activitys.BaseActivity;
import com.xxx.video.commen.configs.Constant;
import com.xxx.video.commen.utils.SPUtil;
import com.xxx.video.commen.utils.StatusBarUtil;

public class AppSettingActivity extends BaseActivity {

    private SwitchCompat mTvAppSettingAutoPlayTitleFirst;

    @Override
    public void initToolbarData() {
        super.initToolbarData();
        showActionBar();
        StatusBarUtil.getInstance().setStatusBarTransparent(this, true);
        setIsShowActionbarLine(true);
        setActionBarTitle(R.string.title_app_setting_activity);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_app_setting;
    }

    @Override
    public void initData(Bundle extras) {
        showLayoutStatus(1);
        mTvAppSettingAutoPlayTitleFirst = findViewById(R.id.sc_app_setting_auto_play_title_first);
        boolean isSet4G = SPUtil.getBoolean(Constant.isSet4G, false);
        mTvAppSettingAutoPlayTitleFirst.setChecked(isSet4G);
        mTvAppSettingAutoPlayTitleFirst.setOnCheckedChangeListener((buttonView, isChecked) -> {
            SPUtil.putBoolean(Constant.isSet4G, isChecked);
        });
    }
}
